home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / SAMPLES / BACKGRND / BACK / COMBACK.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  1.9 KB  |  68 lines

  1. // Copyright (c)1995 Ray Dream, Inc. All Rights Reserved.
  2. /* $Id: COMBack.h 1.1 1996/07/18 23:45:57 Damien Exp $ */
  3.  
  4. //
  5. // COM Example of an Background Shader
  6. //
  7.  
  8. #ifndef __COMBACK__
  9. #define __COMBACK__  
  10.  
  11. #ifndef __I3DEXAB__
  12. #include "I3DExAB.h"
  13. #endif
  14.                   
  15. // define the Sunset CLSID
  16. // ACD41BE0-8243-101C-8BFC-F629D50D262B
  17. DEFINE_GUID(CLSID_Sunset, 0xACD41BE0L, 0x8243, 0x101C, 0x8B, 0xFC, 0xF6, 0x29, 0xD5, 0x0D, 0x26, 0x2B);
  18.  
  19.  
  20. typedef struct BackData {
  21.   COLOR3D fSunColor;
  22.   NUM3D   fSunDiameter;
  23.   NUM3D   fWestDirection;
  24.   COLOR3D fZenithColor;
  25.   COLOR3D fWestColor;
  26.   COLOR3D fEastColor;
  27.   COLOR3D fEarthColor;
  28.   } BackData;
  29.  
  30.  
  31. // Sunset Object :
  32. #undef INTERFACE
  33. #define INTERFACE Sunset
  34. class Sunset : public I3DExBackground {
  35. public :  
  36.   Sunset();
  37.   ~Sunset();
  38.   
  39.   // IUnknown Interface :
  40.   STDMETHODIMP         QueryInterface(THIS_ REFIID riid, LPVOID FAR* ppvObj);
  41.   STDMETHODIMP_(ULONG) AddRef(THIS);
  42.   STDMETHODIMP_(ULONG) Release(THIS);
  43.   
  44.   // I3DExtension method :
  45.   STDMETHODIMP_(I3DExtension*) Clone(THIS);
  46.   STDMETHODIMP                 ShellUtilitiesInit(THIS_ IShUtilities* shellUtilities);  
  47.   
  48.   // I3DExDataExchanger methods :
  49.   STDMETHODIMP_(ExtensionDataMap*) GetExtensionDataMap(THIS);
  50.   STDMETHODIMP_(void*)             GetExtensionDataBuffer(THIS);
  51.   STDMETHODIMP                     ExtensionDataChanged(THIS);
  52.   STDMETHODIMP                     HandleEvent(THIS_ ULONG sourceID);
  53.   STDMETHODIMP_(short)             GetResID(THIS);
  54.   
  55.   // I3DExBackgroundShader methods
  56.   STDMETHODIMP           GetBackgroundColor(THIS_ VECTOR3D* direction, COLOR3D* resultColor);
  57.   
  58. private :
  59.   ULONG     fCRef;      // reference Counter
  60.   BackData  fData;      // Sunset Data
  61.   VECTOR3D  fWestVector;// Vector which gives the West
  62.   NUM3D     fSunLimit;  // Limit (cosinus) of the Sun Diameter
  63.   };
  64.                           
  65.  
  66. #endif // __SUNSET__
  67.  
  68.